#include<iostream>
using namespace std;

int a[200001],n;

int main(){
	cin>>n;
	int tmp;
	for(int i=0;i<n;i++){
		cin>>tmp;
		a[i]=tmp;
	}
	int m;
	cin>>m;
	for(int i=0;i<n;i++){
		if(a[i] == m)	continue;
		cout<<a[i]<<" ";
	}
	cout<<endl;
} 
